/*
 This file 'wxhxpApp' is part of Firebird Integrated Solution 1.0

 Copyright (c) 2020 Lincong

 Contact:  
        Email: lincong1987@gmail.com

        QQ: 159257119
 
 See Usage at http://www.jplatformx.com/firebird

 Create date: 2020-06-14 20:46
 */

define(function (require, exports, module) {
	require("Firebird.App");
	require("Firebird.Controller");
	// require("Format");


	require("../assets/header-datetime");
	require("../assets/flop");


	var wxhxp_1_chart_1 = require("./wxhxp_1_chart_1");
	var wxhxp_1_chart_2 = require("./wxhxp_1_chart_2");
	var wxhxp_2 = require("./wxhxp_2");

	var wxhxp_4_chart_1 = require("./wxhxp_4_chart_1");

	// var wxhxp_4 = require("./wxhxp_4");

	var controller = Firebird.create("Firebird.Controller", {
		controller: "{contextPath}/publicMain"
	});

	Firebird.define("wxhxp.SearchApp", {
		extend: "Firebird.SearchApp",
		controller: controller,
		setContext: function () {
			var app = this, context = this.context;


			context.wxhxp_1_chart_1 = wxhxp_1_chart_1;
			context.wxhxp_1_chart_2 = wxhxp_1_chart_2;
			context.wxhxp_2 = wxhxp_2;
			context.wxhxp_4_chart_1 = wxhxp_4_chart_1;



			wxhxp_1_chart_1.setValue([]);
			wxhxp_1_chart_2.setValue([]);
			wxhxp_2.setValue([]);
			wxhxp_4_chart_1.setValue([]);


			$("#wxhxp_1_flop_1").flop({
				value: 432
			});

			$("#wxhxp_1_tab_flop_1").flop({
				value: 432
			});
			$("#wxhxp_1_tab_flop_2").flop({
				value: 432
			});

			$("#wxhxp_4_flop_1").flop({
				value: 172,
				rich: false
			});


			// 标签 切换
			$(".tab").each(function () {
				var $this = $(this);
				$this.on("click", "a", function (e) {
					e.preventDefault();
					var $a = $(e.target).is("a") ? $(e.target) : $(e.target).closest("a");
					if (!$a.parent().hasClass("tab-header")) {
						return;
					}
					var index = $this.find("a").index($a);
					$a.addClass("active").siblings().removeClass("active")
					$this.find(".tab-content .content").eq(index).addClass("active").siblings().removeClass("active");
				});
			});
		},
		listener: {}
	});


});